package com.auroral.enums;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200,"操作成功"),
    // 登录
    //token过期
    TOKEN_EXPIRED(400,"token无效或已过期"),
    NEED_LOGIN(401,"需要登录后操作"),
    NO_OPERATOR_AUTH(403,"无权限操作"),
    //存在相同记录
    DUPLICATE_RECORD(410,"存在相同记录"),
    //参数错误
    PARAM_ERROR(402,"参数错误"),
    //旧密码输入错误
    OLD_PASSWORD_ERROR(405,"旧密码输入错误"),
    //请求操作不符合规范
    REQUEST_NOT_MATCH(406,"请求操作不符合规范"),
    SYSTEM_ERROR(500,"出现错误"),
    USERNAME_EXIST(501,"用户名已存在"),
    PHONENUMBER_EXIST(502,"手机号已存在"), EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    LOGIN_ERROR(505,"用户名或密码错误");
    int code;
    String msg;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.msg = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
